#! /usr/bin/python
# -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------
# Name:     bootstrap.py
# Purpose:  bootstrap class used to communicate with atmega
# Author:   Fabien Marteau <fabien.marteau@armadeus.com>
# Created:  22/11/2008
#-----------------------------------------------------------------------------
#  Copyright (2008)  Armadeus Systems
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
#-----------------------------------------------------------------------------
# Revision list :
#
# Date       By        Changes
#
#-----------------------------------------------------------------------------

__doc__ = ""
__author__ = "Fabien Marteau <fabien.marteau@armadeus.com>"

import sys
import time
import os
try:
    import serial
except ImportError:
    print "[ERROR]Pyserial is needed : "+\
          "http://pyserial.wiki.sourceforge.net/pySerial"
    #exit()

class BootStrap():
    def __init__(self):
        print "TODO: init BootStrap"

    def put(self,address,value):
        """ Write a value on atmega register
            address : int (16bits)
            value   : int (8bits)
        """
        print "TODO: put %02X at %04X"%(value,address) 

    def get(self,address):
        """ Read a value from atmega register
            address : int (16bits)
            return int
        """
        print "TODO : read value at address %04X"%address
